FROM reg.deeproute.ai/deeproute-all/osrf/ros:melodic-desktop-full

LABEL maintainer="yujiezhao@deeproute.ai"

ARG DEBIAN_FRONTEND=noninteractive

COPY sources.list /etc/apt/

RUN apt-get update \
 && apt-get install -y apt-transport-https software-properties-common gnupg gnupg1 gnupg2 \
 && echo "deb [arch=amd64] https://nexus.deeproute.ai/repository/deeproute-release-1804/ bionic main" > /etc/apt/sources.list.d/deeproute-ai-release-1804.list \
 && echo "deb [arch=amd64] https://nexus.deeproute.ai/repository/deeproute-snapshot-1804/ bionic main"  >> /etc/apt/sources.list.d/deeproute-ai-release-1804.list \
 && apt-key adv --keyserver pgp-sz.deeproute.ai --recv-key  50BB6DC9 \
 && mkdir /root/.ssh

RUN apt-get update \
 && apt-get install -y openssh-client openssh-server jq git wget unzip \
 && apt-get install -y libceres-dev libftgl-dev libglew-dev libgoogle-glog-dev libgsl-dev libcgal-dev \
 && apt-get install -y liblmdb-dev libusb-1.0.0 protobuf-compiler python-protobuf libgtest-dev \
 && apt-get install -y qml-module-qtquick-controls qml-module-qtquick-extras \
 && apt-get install -y autoconf automake libtool curl make g++ libxml-xpath-perl python3-pip python3.8-dev \
 && sed -i '/#include <vector>/a#include <boost/shared_ptr.hpp>' /opt/ros/melodic/include/ros/console.h

COPY config /root/.ssh

RUN chmod 644 /root/.ssh/config \
 && ssh-keyscan -p 2222 code.deeproute.ai >> /root/.ssh/known_hosts

ENTRYPOINT [ "/ros_entrypoint.sh" ]

CMD [ "bash" ]
